//
//  QLPublishSetPriceModel.m
//  谁约
//
//  Created by qlwl on 16/10/20.
//  Copyright © 2016年 qlwl. All rights reserved.
//

#import "QLPublishSetPriceModel.h"

@implementation QLPublishSetPriceModel
@synthesize unitPrice = _unitPrice;
- (void) setUnitType:(ChooseUnitPriceType)unitType
{
    if (_unitType!=unitType) {
        _unitType = unitType;
        NSArray *unitArray = @[@"元/单",@"元/小时",@"元/天",@"元/半天",@"元/分钟"];
        _price = nil;
        if (_unitType != UnitPriceType5) {
            _unitPrice = unitArray[_unitType - 1];
            _time = nil;
        }
    }
}
- (NSString *)unitPrice
{
    if (!_unitPrice) {
        return @"元/单";
    }
    return _unitPrice;
}
- (void) setTime:(NSString *)time
{
    _time = time;
    if (_time!=nil) {
        _unitType = UnitPriceType5;
        _unitPrice = [NSString stringWithFormat:@"元/%@分钟",time];
    }
}
@end
